//
//  ICMBalanceAccountsModel.m
//  ICrEAM
//
//  Created by xphone on 16/11/29.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ICMBalanceAccountsModel.h"

@implementation ICMBalanceAccountsModel

- (void)setUpBalanceBasicInfoModelWithBalanceBasicInfoView:(ICMBalanceBasicInfoView *)balanceBasicInfoView{
    self.RO_NO = balanceBasicInfoView.proxyNOView.contentText;
    self.VIN = balanceBasicInfoView.vinNumberView.contentText;
    self.TRACE_TIME = [ICrEAMTool getDeatilCodeWithParameterDesc:balanceBasicInfoView.visitDateView.contentText withCode:ICMEnumIntToString(ICMEnumTraceTimePre)];
    self.REVISIT_WAY = [ICrEAMTool getDeatilCodeWithParameterDesc:balanceBasicInfoView.visitTypeView.contentText withCode:ICMEnumIntToString(ICMEnumRevisitWayPre)];
    self.NO_TRACE = [ICrEAMTool getDeatilCodeWithParameterDesc:balanceBasicInfoView.visitReasonView.contentText withCode:ICMEnumIntToString(ICMEnumNoTracePre)];
    self.USE_KIND = [ICrEAMTool getDeatilCodeWithParameterDesc:balanceBasicInfoView.useKindView.contentText withCode:ICMEnumIntToString(ICMEnumUseKindPre)];
    self.BALANCE_TYPE = [ICrEAMTool getDeatilCodeWithParameterDesc:balanceBasicInfoView.accountsTypeView.contentText withCode:ICMEnumIntToString(ICMEnumBalanceTypePre)];
    self.HONEST_BUSINESS = balanceBasicInfoView.HONEST_BUSINESS;
    //
    self.REPAIR_ORDER_TYPE_CODE = balanceBasicInfoView.levelView.noStr;
    self.REMARK = balanceBasicInfoView.remarkView.contentText;
}

- (void)setupBalanceBasicInfoModelWithBalanceMaintenanceAndPartsView:(ICMBalanceMaintenanceAndPartsView *)balanceBasicInfoView{
    self.DISCOUNT_OPERATOR = balanceBasicInfoView.levelNo;
    self.LABOUR_RATE = balanceBasicInfoView.workingRatioView.contentText;
    self.PART_RATE = balanceBasicInfoView.partsRatioView.contentText;
    self.LABOUR_PRICE = balanceBasicInfoView.workingUnitPriceView.contentText;
    self.DISCOUNT_MODE_CODE  = balanceBasicInfoView.discountModeView.noStr;
}

- (void)setUpBalanceBasicInfoModelWithBalanceInfoView:(ICMBalanceInfoView *)balanceBasicInfoView{
    self.REPAIR_LABOUR_AMOUNT = balanceBasicInfoView.labourAccounts.subtitleLabel.text;
    self.REPAIR_PART_AMOUNT = balanceBasicInfoView.partAccounts.subtitleLabel.text;
    self.BALANCE_AMOUNT = balanceBasicInfoView.amountAccounts.subtitleLabel.text;
    self.RECEIVE_AMOUNT = balanceBasicInfoView.accounts.subtitleLabel.text;
    self.HQ_VW_CARD_ID = balanceBasicInfoView.cardNoView.contentText;
    self.HQ_VW_CARD_FORM_DESC = balanceBasicInfoView.HQ_VW_CARD_FORM_DESC;
    self.HQ_VW_CARD_FORM = balanceBasicInfoView.HQ_VW_CARD_FORM;
    self.HQ_VW_PRE_DEDUCT_CREDIT = balanceBasicInfoView.withholdIntegralView.contentText;
    self.HQ_VW_CARD_TYPE = balanceBasicInfoView.HQ_VW_CARD_TYPE;
    self.HQ_VW_MEMBER_PROPERTY = balanceBasicInfoView.MEMBER_PROPERTY_NAME;
    self.MEMBER_PROPERTY_NAME = balanceBasicInfoView.MEMBER_PROPERTY_NAME;
    self.HQ_VW_USED_CREDIT_AMOUNT = balanceBasicInfoView.VWUseIntegralView.contentText;
    self.CHECK_CODE = balanceBasicInfoView.verificationView.contentText;
    self.MEMBER_NO = balanceBasicInfoView.memberIDView.contentText;
    self.CARD_ID = balanceBasicInfoView.CARD_ID;
    self.SVW_CRRNT_USED_CRDT_AMT = [NSString stringWithFormat:@"%.2f", [balanceBasicInfoView.labourHourIntegralView.contentText doubleValue] + [balanceBasicInfoView.partIntegralView.contentText doubleValue]];
    self.LABOUR_DEDUCT_AMOUNT = balanceBasicInfoView.labourDeduction.subtitleLabel.text;
    self.MATERIAL_DEDUCT_AMOUNT = balanceBasicInfoView.partDeduction.subtitleLabel.text;
}

- (void)setUpBalanceBasicInfoModelWithBalanceInfoSKDView:(ICMBalanceInfoSKDView *)balanceBasicInfoView{
    self.REPAIR_LABOUR_AMOUNT = balanceBasicInfoView.labourAccounts.subtitleLabel.text;
    self.REPAIR_PART_AMOUNT = balanceBasicInfoView.partAccounts.subtitleLabel.text;
    self.BALANCE_AMOUNT = balanceBasicInfoView.amountAccounts.subtitleLabel.text;
    self.RECEIVE_AMOUNT = balanceBasicInfoView.accounts.subtitleLabel.text;
    self.CHECK_CODE = balanceBasicInfoView.verificationView.contentText;
    self.SKD_HQTRS_CRDT_AMT = balanceBasicInfoView.SKDDeductionView.contentText;
    self.SKD_DEALER_CRDT_AMT = balanceBasicInfoView.SSTDeductionView.contentText;
    self.LABOUR_DEDUCT_AMOUNT = balanceBasicInfoView.labourDeduction.subtitleLabel.text;
    self.MATERIAL_DEDUCT_AMOUNT = balanceBasicInfoView.partDeduction.subtitleLabel.text;
    self.MEMBER_NO = balanceBasicInfoView.cardNoView.contentText;

}


@end
